#include<stdio.h>

int a[110];

int main()
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    int k;
    scanf("%d", &k);
    int l = 0, r = n;
    while (l < r)
    {
        int mid = (l + r) / 2;
        if (a[mid] >= k)    r = mid;
        else l = mid + 1;
    }
    if (a[l] != k)
        printf("-1");
    else
        printf("%d", l);
    return 0;
}